// 引入vue
import Vue from 'vue'
// 引入组件对象
import Find from '../views/Find.vue'
import My from '../views/My.vue'
import Friends from '../views/Friends.vue'
import Recommend from '../views/Second/Recommend.vue'
import Ranking from '../views/Second/Ranking.vue'
import SongList from '../views/Second/SongList.vue'
// 第一步: 下载router包指定版本号@3.5.3
// 1. 引入vue-router
import VueRouter from 'vue-router'
// 安装VueRouter插件
Vue.use(VueRouter)

// 创建路由对象
const router = new VueRouter({
  // 配置路由信息
  routes: [
    {
      path: '/friends',
      component: Friends,
    },
    {
      path: '/my',
      component: My,
    },
    {                 //  一个对象就表示一个路由规则
      path: '/find',
      name: 'Find',
      component: Find,
      children: [
        {
          path: 'recommend',
          component: Recommend,
        },
        {
          path: 'ranking',
          component: Ranking,
        },
        {
          path: 'songlist',
          component: SongList,
        },
      ]
    }
  ]
})

// 通过默认导出, 导出路由对象
export default router













